﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ATM.Entities;

namespace ATM.DataAccess
{
    public class CustomerDal
    {
        //Lay Customer theo ID
        public Customer GetCustomer(int custId)
        {
            return VirtualData.CustomerList.FirstOrDefault(t => t.CustomerId == custId);
        }

        //Them moi mot customer
        public bool CreateNewCustomer(int custId, string custName, string custEmail, string phone, string address)
        {
            VirtualData.CustomerList.Add(new Customer
                                             {
                                                 Address = address,
                                                 CustomerId = custId,
                                                 CustomerName = custName,
                                                 Email = custEmail,
                                                 Phone = phone
                                             });
            return true;
        }
		public bool CreateNewCustomer(Customer cust)
		{
			VirtualData.CustomerList.Add(cust);
            return true;
		}
    }
}
